/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pig.common.file.oss;

import lombok.Data;

/**
 * OSS对象存储配置属性类
 * <p>
 * 支持AWS S3协议的对象存储配置，包括MinIO、阿里云OSS等兼容S3协议的存储服务
 * </p>
 * 
 * 配置示例：
 * <pre>
 * file:
 *   oss:
 *     enable: true
 *     endpoint: http://127.0.0.1:9000
 *     pathStyleAccess: true  # nginx反向代理或AWS S3配置为true，阿里云等配置为false
 *     access-key: lengleng
 *     secret-key: lengleng
 *     bucket-name: lengleng
 *     region: us-east-1
 *     custom-domain: https://oss.xxx.com/lengleng
 * </pre>
 * 
 * 注意：bucket需要设置公共读权限
 *
 * @author lengleng
 * @author 858695266
 * @date 2025/05/31
 */
@Data
public class OssProperties {

	/**
	 * 对象存储服务的URL
	 */
	private String endpoint;

	/**
	 * 自定义域名
	 */
	private String customDomain;

	/**
	 * 路径访问模式
	 * <p>
	 * true: path-style模式 {http://endpoint/bucketname}，适用于nginx反向代理和S3
	 * false: virtual-hosted-style模式 {http://bucketname.endpoint}，适用于阿里云OSS等
	 * </p>
	 */
	private Boolean pathStyleAccess = true;

	/**
	 * 应用ID
	 */
	private String appId;

	/**
	 * 区域
	 */
	private String region;

	/**
	 * 访问密钥ID
	 * <p>
	 * 用于标识用户身份的访问凭证
	 * </p>
	 */
	private String accessKey;

	/**
	 * 访问密钥
	 * <p>
	 * 用于签名验证的密钥，需要妥善保管
	 * </p>
	 */
	private String secretKey;

	/**
	 * 最大线程数，默认： 100
	 */
	private Integer maxConnections = 100;

}
